#include<stdio.h>
#define N 25
struct score{
    char num[N],nam[N];
    int math,C;
}sc;
int main(){
    int i,n,cnt=0;
    struct score a[20];
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%s%s%d%d",a[i].num,a[i].nam,&a[i].math,&a[i].C);
        if(a[i].C>=60)  cnt++;
    }
    printf("%d\n",cnt);
    for(i=0;i<n;i++){
        if(a[i].C>=60){
            printf("%s %s\n",a[i].num,a[i].nam);
        }
    }
}